package com.tedu.springdemo.day04;


//实例工厂 方法：返回值 返回对象
//@Bean 注解      用于方法上，返回对象

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class NetConnInstanceFactory {
    @Bean("nc")
    public NetConnection getInstance(){
        NetConnection nc=new NetConnection();
        nc.load();
        nc.ping();
        nc.conn();
        return nc;
    }
}
